x ^= yRaise one Python object to the power of another, and assign the result to the first argument.
|
|
|
In addition to the Macaulay2-style ^=, this operation is also available using the Python-style **=.
|
|
|
If the right-hand side is a Macaulay2 object, then it is first converted to a Python object before exponentiating.
|
|
|
If the Python class of x defines an __ipow__ method for in-place exponentiation, then it will be called. Otherwise, x will be raised to the y power in the usual way, creating a new Python object that is assigned back to x.
For example, NumPy arrays support in-place exponentiation. In the example below, x is modified directly, and no new object is created.
|
|
|
|
The source of this document is in Python/doc/arithmetic.m2:849:0.